package com.soft.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {
    @RequestMapping("testThymeleaf")
    public String testTh(Model model){
        model.addAttribute("msg", "你好！");
        return "testThymeleaf";
    }
    @RequestMapping("login")
    public String testLoginView(Model model){
        model.addAttribute("msg", "你好！");
        return "user/login";
    }
    @GetMapping("fragment")
    @ResponseBody
    public String fragment(Model model){
        model.addAttribute("data","你好");
        return "fra";
    }
}
